Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.java.swing.undo.AbstractUndoableEdit | +--com.sun.java.swing.undo.CompoundEdit | +--com.sun.java.swing.undo.UndoManager
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Fields inherited from class com.sun.java.swing.undo.CompoundEdit | |
edits |
Fields inherited from class com.sun.java.swing.undo.AbstractUndoableEdit | |
RedoName, UndoName |
Constructor Summary | |
UndoManager()
|
Method Summary | |
boolean | addEdit(UndoableEdit anEdit)
If inProgress, inserts anEdit at indexOfNextAdd, and removes any old edits that were at indexOfNextAdd or later. |
boolean | canRedo()
Overridden to preserve usual semantics: returns true if a redo operation would be successful now, false otherwise |
boolean | canUndoOrRedo()
Return true if calling undoOrRedo will undo or redo. |
boolean | canUndo()
Overridden to preserve usual semantics: returns true if an undo operation would be successful now, false otherwise |
void | discardAllEdits()
Empty the undo manager, sending each edit a die message in the process. |
UndoableEdit | editToBeRedone()
Returns the the next significant edit to be redone if redo is called. |
UndoableEdit | editToBeUndone()
Returns the the next significant edit to be undone if undo is called. |
int | getLimit()
Returns the maximum number of edits this UndoManager will hold. |
java.lang.String | getRedoPresentationName()
If inProgress, returns getRedoPresentationName of the significant edit that will be redone when redo() is invoked. |
java.lang.String | getUndoOrRedoPresentationName()
Return the appropriate name for a command that toggles between undo and redo. |
java.lang.String | getUndoPresentationName()
If inProgress, returns getUndoPresentationName of the significant edit that will be undone when undo() is invoked. |
void | redoTo(UndoableEdit edit)
Redoes all changes from indexOfNextAdd to edit. |
void | redo()
If this UndoManager is inProgress, redoes the last significant UndoableEdit at indexOfNextAdd or after, and all insignificant edits up to it. |
void | setLimit(int l)
Set the maximum number of edits this UndoManager will hold. |
java.lang.String | toString()
|
void | trimEdits(int from,
int to)
Tell the edits in the given range (inclusive) to die, and remove them from edits. from > to is a no-op. |
void | trimForLimit()
Reduce the number of queued edits to a range of size limit, centered on indexOfNextAdd. |
void | undoableEditHappened(UndoableEditEvent e)
Called by the UndoabledEdit sources this UndoManager listens to. |
void | undoOrRedo()
Undo or redo as appropriate. |
void | undoTo(UndoableEdit edit)
Undoes all changes from indexOfNextAdd to edit. |
void | undo()
If this UndoManager is inProgress, undo the last significant UndoableEdit before indexOfNextAdd, and all insignificant edits back to it. |
Methods inherited from class com.sun.java.swing.undo.CompoundEdit | |
addEdit, canRedo, canUndo, die, end, getPresentationName, getRedoPresentationName, getUndoPresentationName, isInProgress, isSignificant, lastEdit, redo, toString, undo |
Methods inherited from class com.sun.java.swing.undo.AbstractUndoableEdit | |
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, redo, replaceEdit, toString, undo |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Constructor Detail |
public UndoManager()
Method Detail |
public int getLimit()
public void discardAllEdits()
protected void trimForLimit()
protected void trimEdits(int from, int to)
public void setLimit(int l)
protected UndoableEdit editToBeUndone()
protected UndoableEdit editToBeRedone()
protected void undoTo(UndoableEdit edit) throws CannotUndoException
protected void redoTo(UndoableEdit edit) throws CannotRedoException
public void undoOrRedo() throws CannotRedoException, CannotUndoException
public boolean canUndoOrRedo()
public void undo() throws CannotUndoException
If not inProgress, indexOfNextAdd is ignored and super's routine is called.
public boolean canUndo()
public void redo() throws CannotRedoException
If not inProgress, indexOfNextAdd is ignored and super's routine is called.
public boolean canRedo()
public boolean addEdit(UndoableEdit anEdit)
If not inProgress, acts as a CompoundEdit
public java.lang.String getUndoOrRedoPresentationName()
public java.lang.String getUndoPresentationName()
If inProgress, returns getUndoPresentationName of the significant edit that will be undone when undo() is invoked. If there is none, returns AbstractUndoableEdit.UndoName
If not inProgress, acts as a CompoundEdit
public java.lang.String getRedoPresentationName()
If not inProgress, acts as a CompoundEdit
public void undoableEditHappened(UndoableEditEvent e)
public java.lang.String toString()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |